package com.example.controller;

import com.example.service.OrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@Slf4j
public class ApiController {

    @Autowired
    private OrderService orderService;

    @GetMapping(value = "/pay")
    public String alipay() {
        log.info("我开始了！");
        String result = orderService.alipay();
        log.info("我结束了！{}", result);
        return result;
    }

    @GetMapping(value = "/insert")
    public String insert() throws InterruptedException {
        log.info("我开始了！");
        orderService.insert();
        log.info("结束了！");
        return "ok";
    }
}